package sheji.Sinle2;

/**
 * @author lj
 * @Description: 单列模式-懒汉式
 * @date 2020-10-29 21:38
 * @QQ 851477108
 */


public class SingleObject {
    private final static SingleObject instance = new SingleObject();

    private SingleObject(){}

    public static synchronized SingleObject getInstance(){
        return instance;
    }

    public void showMessage(){
        System.out.println("懒汉式!");
    }
}
